package com.chance.cc.crawler.prod.command.trigger.domain.commerce.gome;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.commerce.gome.realtime.GomeArticleCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.gome.realtime.GomeCommentCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.gome.realtime.GomeCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

public class GomeCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
        publishGomeCrawlerScheduleTriggerInfo();
        //publishGomeArticleCrawlerScheduleTriggerInfo();
       // publishGomeCommentCrawlerScheduleTriggerInfo();
    }
    public static void publishGomeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = GomeCrawlerScheduleJob.articleUrlSchedule();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                GomeCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0 l * ?",//0 0 0 l * ?
                "国美商城根据关键字采集商品url"
        );
    }
    public static void publishGomeArticleCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = GomeArticleCrawlerScheduleJob.articleSchedule();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                GomeArticleCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 14 * * ?",//0 0 14 * * ? 每天两点
                "国美商城根据关键字采集商品信息"
        );
    }
    public static void publishGomeCommentCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = GomeCommentCrawlerScheduleJob.commentSchedule();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                GomeArticleCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",//
//                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
//                "",
                "国美商城根据关键字采集最新评论"
        );
    }
}
